package day20180131.designMode.eleven_facade;

/**
 * Created by 14394 on 2018/1/31.
 */
public class WashingMachine {

    public void shuixi(){
        System.out.println("水洗");
    }

    public void piaoxi(){
        System.out.println("漂洗");
    }

    public void tuoshui(){
        System.out.println("脱水");
    }
}

class AutomatioWashingMachine{
    private WashingMachine washingMachine = new WashingMachine();

    public void washingClothes(){
        washingMachine.shuixi();
        washingMachine.piaoxi();
        washingMachine.tuoshui();
    }

    /*使用场景：   为一个复杂的模块或者子系统提供一个供外部访问的接口
    *             子系统相对独立
    *             预防低水平人员带来的风险扩散
    * */
    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        Class c = Class.forName("day20180131.designMode.eleven_facade.AutomatioWashingMachine");
        Object o = c.newInstance();
        AutomatioWashingMachine automatioWashingMachine = (AutomatioWashingMachine) o;
        automatioWashingMachine.washingClothes();
    }

}